<?php

function generatePreferencesCookie(){

	if(!isset($_COOKIE['newspapers'])){

		//seconds * minutes * hours * days + current time
		$expirationTime = 60 * 60 * 24 * 365 + time(); 

		setcookie('newspapers', getDefaultCookieString(), $expirationTime); 

	}

}

function getDefaultCookieString(){

	$property = 'properties/rssFeeds.xml';
	$array_fuentes = simplexml_load_file($property);
	
	$newspapers = null;

	//Itero por todos los diarios
	foreach($array_fuentes as $fuente){
		$newspapers = $newspapers . "1";
	}

	return $newspapers;

}

?>

